home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SOURCE.BIN / Coordinate.java < prev    next >
Encoding:
Java Source  |  1997-06-19  |  1.1 KB  |  48 lines

  1. /*
  2.  * Coordinate.java   1.0   12 Jan 1997
  3.  *
  4.  * Copyright (c) 1996 Krumel & Associates, Inc.  All Rights Reserved.
  5.  *
  6.  * This software is provided as is.  Krumel & Associates shall not be liable
  7.  * for any damages suffered by licensee as a result of using, modifying or
  8.  * distributing this software or its derivatives.
  9.  */
  10.  
  11. package symantec.itools.db.awt;
  12.  
  13. public class Coordinate {
  14.     public int row;
  15.     public int col;
  16.  
  17.     public Coordinate() {}
  18.  
  19.     public Coordinate(Coordinate c) {
  20.         this(c.row, c.col);
  21.     }
  22.  
  23.     public Coordinate(int r, int c) {
  24.         row = r;
  25.         col = c;
  26.     }
  27.  
  28.     public boolean equals(Object o) {
  29.         if (!(o instanceof Coordinate)) {
  30.             return false;
  31.         }
  32.  
  33.         Coordinate c = (Coordinate)o;
  34.         return row == c.row && col == c.col;
  35.     }
  36.  
  37.     public void setRow(int r) { row = r; }
  38.  
  39.     public void setCol(int c) { col = c; }
  40.  
  41.     public int row() { return row; }
  42.  
  43.     public int col() { return col; }
  44.  
  45.     public String toString() {
  46.         return "Coordinate: row=" + row + " col=" + col;
  47.     }
  48. }